<template>
	<view class="">
		<view class="fenzhang_top">
			<view class="date_tab">
				<view :class="{active:index===0}" @click="index=0;" class="top_tab"
					:style='{"border-bottom":border}'>今日</view>
				<view :class="{active:index===1}" @click="index=1;" class="top_tab"
					:style='{"border-bottom":border}'>昨日</view>
				<view :class="{active:index===2}" @click="index=2;" class="top_tab"
					:style='{"border-bottom":border}'>近7天</view>
				<view :class="{active:index===3}" @click="index=3;" class="top_tab"
					:style='{"border-bottom":border}'>近30天</view>
			</view>
		</view>
		<!--通过判断index值是否与自身赋好的值相等进行相对应的显示-->
		<view v-show="index===0" class="turnove">
			<view class="turnove-top">
				<view class="turnove-block">
					<view class="turnove-num1 turnove-num">{{today_rk_total}}</view>
					<view class="turnove-text">今日入库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num2 turnove-num">{{today_ck_total}}</view>
					<view class="turnove-text">今日出库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num3 turnove-num">{{today_kc_total}}</view>
					<view class="turnove-text">今日库存</view>
				</view>
			</view>
			<view class="uni-padding-wrap uni-common-mt">
				<uni-segmented-control :current="current" :values="items" :active-color="activeColor"
					@clickItem="onClickItem" />
			</view>
			<view class="content">
				<view v-if="current === 0">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in today_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2" :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
						<view class="odo_list" v-for="(item,index) in today_ck_list" >
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2" :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 1">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in today_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 2">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in today_ck_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-show="index===1">
			<view class="turnove-top">
				<view class="turnove-block">
					<view class="turnove-num1 turnove-num">{{tomorrow_rk_total}}</view>
					<view class="turnove-text">昨天入库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num2 turnove-num">{{tomorrow_ck_total}}</view>
					<view class="turnove-text">昨天出库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num3 turnove-num">{{tomorrow_kc_total}}</view>
					<view class="turnove-text">昨天库存</view>
				</view>
			</view>
			<view class="uni-padding-wrap uni-common-mt">
				<uni-segmented-control :current="current" :values="items" :active-color="activeColor"
					@clickItem="onClickItem" />
			</view>
			<view class="content">
				<view v-if="current === 0">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in tomorrow_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2" :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
						<view class="odo_list" v-for="(item,index) in tomorrow_ck_list" >
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2" :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 1">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in tomorrow_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 2">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in tomorrow_ck_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-show="index===2">
			<view class="turnove-top">
				<view class="turnove-block">
					<view class="turnove-num1 turnove-num">{{week_rk_total}}</view>
					<view class="turnove-text">近7天入库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num2 turnove-num">{{week_ck_total}}</view>
					<view class="turnove-text">近7天出库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num3 turnove-num">{{week_kc_total}}</view>
					<view class="turnove-text">近7天库存</view>
				</view>
			</view>
			<view class="uni-padding-wrap uni-common-mt">
				<uni-segmented-control :current="current" :values="items" :active-color="activeColor"
					@clickItem="onClickItem" />
			</view>
			<view class="content">
				<view v-if="current === 0">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in week_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2" :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
						<view class="odo_list" v-for="(item,index) in week_ck_list" >
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2" :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 1">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in week_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 2">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in week_ck_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-show="index===3">
			<view class="turnove-top">
				<view class="turnove-block">
					<view class="turnove-num1 turnove-num">{{month_rk_total}}</view>
					<view class="turnove-text">近30天入库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num2 turnove-num">{{month_ck_total}}</view>
					<view class="turnove-text">近30天出库</view>
				</view>
				<view class="turnove-block">
					<view class="turnove-num3 turnove-num">{{month_kc_total}}</view>
					<view class="turnove-text">近30天库存</view>
				</view>
			</view>
			<view class="uni-padding-wrap uni-common-mt">
				<uni-segmented-control :current="current" :values="items" :active-color="activeColor"
					@clickItem="onClickItem" />
			</view>
			<view class="content">
				<view v-if="current === 0">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in month_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2" :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
						<view class="odo_list" v-for="(item,index) in month_ck_list" >
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2" :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 1">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in month_rk_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ruColor}'>
										入库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ruColor}'>
										-{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									供应商姓名：{{item.supplier_name}}
								</view>
								<view class="odo_bottomRight">
									入库时间:{{item.hp_sj_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
				<view v-if="current === 2">
					<view class="odo">
						<view class="odo_list" v-for="(item,index) in month_ck_list" :key="index">
							<view class="odo_center">
								<view class="odo_centerLeft">
									<view class="">
										货品名称：{{item.hp_name}}
									</view>
									<view class="">
										货品编号：{{item.hp_price}}
									</view>
									<view class="">
										货品颜色：{{item.hp_color}}
									</view>
									<view class="">
										货品尺码：{{item.hp_size}}
									</view>
									<view class="">
										入库数量：{{item.hp_num}}
									</view>
								</view>
								<view class="odo_centerRight">
									<view class="odo_centerRight1" :style='{"background-color":ckColor}'>
										出库
									</view>
									<view class="odo_centerRight2"  :style='{"color":ckColor}'>
										+{{item.hp_num*item.hp_price}}
									</view>
								</view>
							</view>
							<view class="odo_bottom">
								<view class="odo_bottomLeft">
									开单人：{{item.staff_name}}
								</view>
								<view class="odo_bottomRight">
									出库时间:{{item.hp_ck_time}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				items: ['全部', '入库', '出库'],
				current: 0,
				activeColor: '#fccc04',
				index: 0,
				border: "",
				ckColor:"#33c98c",
				ruColor:"#f94803",
				odo_list: [],
				today_rk_list:[],
				tomorrow_rk_list:[],
				week_rk_list:[],
				month_rk_list:[],
				today_ck_list:[],
				tomorrow_ck_list:[],
				week_ck_list:[],
				month_ck_list:[],
			}
		},
		created() {
			
		},
		methods: {
			onClickItem(e) {
				if (this.current !== e.currentIndex) {
					this.current = e.currentIndex
				}
			},
			onLoad() {
				uni.getSystemInfo({
					success: (res) => {
						res.screenHeight
						this.phone_height = (res.screenHeight * (750 / res.windowWidth))
					}
				})
			},
			ruturn_fn() {
				uni.navigateTo({
					url: '/pages/hptj/hptj'
				})
			}

		},
		computed: {
			nowDate: function() {
				var oldDate = new Date();
				var date = {
					year: oldDate.getFullYear(),
					month: oldDate.getMonth() + 1,
					date: oldDate.getDate(),
				};
				var newmonth = date.month > 10 ? date.month : "0" + date.month;
				var newday = date.date > 10 ? date.date : "0" + date.date;
				return date.year + "-" + newmonth + "-" + newday
			},
			tomorrow_Date: function() {
				var olddate = +new Date();
				
				var before = olddate-1000*60*60*24;
				
				var beforeDate = new Date(before)
			
				var date = {
					year: beforeDate.getFullYear(),
					month: beforeDate.getMonth() + 1,
					date: beforeDate.getDate(),
				};
				var newmonth = date.month > 10 ? date.month : "0" + date.month;
				var newday = date.date > 10 ? date.date : "0" + date.date;
				return date.year + "-" + newmonth + "-" + newday
			},
			week_Date: function() {
				var olddate = +new Date();
				
				var before = olddate-1000*60*60*24*7;
				
				var beforeDate = new Date(before)
				
				var date = {
					year: beforeDate.getFullYear(),
					month: beforeDate.getMonth() + 1,
					date: beforeDate.getDate(),
				};
				var newmonth = date.month > 10 ? date.month : "0" + date.month;
				var newday = date.date > 10 ? date.date : "0" + date.date;
				return date.year + "-" + newmonth + "-" + newday
			},
			month_Date: function() {
				var olddate = +new Date();
				
				var before = olddate-1000*60*60*24*30;
				
				var beforeDate = new Date(before)
				
				var date = {
					year: beforeDate.getFullYear(),
					month: beforeDate.getMonth() + 1,
					date: beforeDate.getDate(),
				};
				var newmonth = date.month > 10 ? date.month : "0" + date.month;
				var newday = date.date > 10 ? date.date : "0" + date.date;
				return date.year + "-" + newmonth + "-" + newday
			},
			today_rk_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.today_rk_list.length; i++) {
					a = a + parseInt(this.today_rk_list[i].hp_num * this.today_rk_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			tomorrow_rk_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.tomorrow_rk_list.length; i++) {
					a = a + parseInt(this.tomorrow_rk_list[i].hp_num * this.tomorrow_rk_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			week_rk_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.week_rk_list.length; i++) {
					a = a + parseInt(this.week_rk_list[i].hp_num * this.week_rk_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			month_rk_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.month_rk_list.length; i++) {
					a = a + parseInt(this.month_rk_list[i].hp_num * this.month_rk_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			today_ck_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.today_ck_list.length; i++) {
					a = a + parseInt(this.today_ck_list[i].hp_num * this.today_ck_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			tomorrow_ck_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.tomorrow_ck_list.length; i++) {
					a = a + parseInt(this.tomorrow_ck_list[i].hp_num * this.tomorrow_ck_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			week_ck_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.week_ck_list.length; i++) {
					a = a + parseInt(this.week_ck_list[i].hp_num * this.week_ck_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			month_ck_total: function() {
				var a = parseInt("0")
				for (var i = 0; i < this.month_ck_list.length; i++) {
					a = a + parseInt(this.month_ck_list[i].hp_num * this.month_ck_list[i].hp_price)
				}
				return a.toFixed(2)
			},
			today_kc_total: function() {
				var a = parseInt("0")
				a = this.today_rk_total - this.today_ck_total
				return a.toFixed(2)
			},
			tomorrow_kc_total: function() {
				var a = parseInt("0")
				a = this.tomorrow_rk_total - this.tomorrow_ck_total
				return a.toFixed(2)
			},
			week_kc_total: function() {
				var a = parseInt("0")
				a = this.week_rk_total - this.week_ck_total
				return a.toFixed(2)
			},
			month_kc_total: function() {
				var a = parseInt("0")
				a = this.month_rk_total - this.month_ck_total
				return a.toFixed(2)
			},
		},
		created() {
			uni.request({
				url: "http://localhost:3000/today_rk",
				data: {
					nowDate: this.nowDate
				},
				success: (res) => {
					this.today_rk_list = res.data.data
				},
			})
			uni.request({
				url: "http://localhost:3000/tomorrow_rk",
				data: {
					tomorrow_Date: this.tomorrow_Date
				},
				success: (res) => {
					this.tomorrow_rk_list = res.data.data
				},
			})
			uni.request({
				url: "http://localhost:3000/week_rk",
				data: {
					week_Date: this.week_Date,
					nowDate:this.nowDate
				},
				success: (res) => {
					this.week_rk_list = res.data.data
				},
			})
			uni.request({
				url: "http://localhost:3000/month_rk",
				data: {
					month_Date: this.month_Date,
					nowDate:this.nowDate
				},
				success: (res) => {
					this.month_rk_list = res.data.data
				},
			})
			uni.request({
				url: "http://localhost:3000/today_ck",
				data: {
					nowDate: this.nowDate
				},
				success: (res) => {
					this.today_ck_list = res.data.data
				},
			})
			uni.request({
				url: "http://localhost:3000/tomorrow_ck",
				data: {
					tomorrow_Date: this.tomorrow_Date
				},
				success: (res) => {
					this.tomorrow_ck_list = res.data.data
				},
			})
			uni.request({
				url: "http://localhost:3000/week_ck",
				data: {
					week_Date: this.week_Date,
					nowDate: this.nowDate
				},
				success: (res) => {
					this.week_ck_list = res.data.data
				},
			})
			uni.request({
				url: "http://localhost:3000/month_ck",
				data: {
					month_Date: this.month_Date,
					nowDate: this.nowDate
				},
				success: (res) => {
					this.month_ck_list = res.data.data
				},
			})
		},
	}
</script>

<style>
	.fenzhang_top {
		width: 100%;
		height: 80rpx;
		background-color: #fff;
	}

	.turnove-top {
		width: 100%;
		height: 200rpx;
		background-color: #fff;
		display: flex;
	}

	.turnove-block {
		flex: 1;
		text-align: center;
		font-size: 36rpx;
	}

	.turnove-num {
		margin-top: 60rpx;
	}

	.turnove-text {
		font-size: 32rpx;
	}

	.turnove-num1 {
		color: #f94803;
	}

	.turnove-num2 {
		color: #33c98c;
	}

	.date_tab {
		width: 90%;
		height: 80rpx;
		margin: 10rpx auto;
		display: flex;
	}

	.top_tab {
		flex: 1;
		text-align: center;
		line-height: 80rpx;
		font-size: 34rpx;
		font-weight: bold;
	}

	.uni-common-mt {
		margin-top: 10px;
	}

	.uni-padding-wrap {
		// width: 750rpx;
		padding: 0px 10px;
	}

	.content {
		/* #ifndef APP-NVUE */
		/* display: flex; */
		/* #endif */
		/* justify-content: center; */
		align-items: center;
		text-align: center;
	}

	.odo {
		background-color: white;
		margin: auto;
		margin-top: 20rpx;
		position: relative;
		width: 94%;
	}

	.odo_center {
		height: 300rpx;
		border-bottom: 5rpx dotted #eee;
		width: 100%;
		padding: 20rpx 0;
		box-sizing: border-box;
		/* float: left; */
	}
	
	.odo_centerLeft {
		width: 60%;
		float: left;
		line-height: 50rpx;
		font-size: 35rpx;
		color: #494848;
		padding-top: 10rpx;
		text-align: left;
	}

	.odo_centerRight {
		width: 40%;
		float: left;
		position: relative;
	}

	.odo_centerRight1 {
		width: 100rpx;
		height: 50rpx;
		background-color: #f94803;
		color: white;
		border-radius: 8rpx;
		position: absolute;
		right: 60rpx;
		top: 80rpx;
	}

	.odo_centerRight2 {
		color: #f94803;
		position: absolute;
		right: 50rpx;
		top: 160rpx;
		font-size: 38rpx;
	}
	.odo_bottom {
		display: flex;
		width: 100%;
		margin: auto;
		line-height: 100rpx;
		font-size: 36rpx;
	}

	.odo_bottomLeft {
		flex: 1;
		text-align: left;
	}

	.odo_bottomRight {
		flex: 1;
		text-align: left;
	}
</style>
